<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <title>预警配置</title>
    <style>
    .table>tbody>tr>td{
        vertical-align: middle;
    }
    .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th{
        border: none;
    }
    .form-control{
        display: inline-block;
        width: 80%;
    }
    .radio{
        margin-top: 0;
    }
    .thStyle1{
        width: 187px;
    }
    .thStyle2{
        width: 15%;
    }
    .thStyle22{
        width: 25%;
    }
    .hpanel .panel-body{
        padding:10px;
    }
    .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th{
        padding: 8px 4px 8px 4px;
    }
    .checkbox-inline, .radio-inline{
        padding-left: 0;
    }
    .checkboxStyle{
        display: inline-block;
    }
    .tdselect1{
        width: 100px;
    }
    .tdselect2{
        width: 200px;
    }
    .select11{
        width: 100px;
    }
    .select22{
        width: 200px;
    }
    /*.flex{*/
        /*justify-content: center;*/
        /*display: flex;*/
        /*align-items: center;*/
    /*}*/
    </style>

    <asset:stylesheet src="homer/vendor/ladda-themeless.min.css"/>
    <asset:javascript src="echarts/Chart.min.js"/>
    <asset:javascript src="homer/vendor/index.js"/>
    <asset:javascript src="homer/vendor/spin.min.js"/>
    <asset:javascript src="homer/vendor/ladda.min.js"/>
    <asset:javascript src="homer/vendor/ladda.jquery.min.js"/>
    <asset:javascript src="echarts/echarts-all-3.js" />
</head>

<body class="fixed-navbar fixed-sidebar">
<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li>CINDATA PLS</li>
                    <li class="active">
                        <span>配置</span>
                    </li>
                </ol>
            </div>

            <h2 class="font-light m-b-xs">
                预警配置
            </h2>
        </div>
    </div>
</div>

<div class="content animate-panel">

    %{--押品价值波动风险配置--}%
    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                押品价值波动风险配置
            </div>
            <div class="panel-body">
                <div class="table-responsive" style="overflow-x:inherit">
                    <table cellpadding="1" cellspacing="1" class="table text-left" style="border:none">
                        <thead>
                            <tr>
                                <th class="sortable thStyle1"><h4 class="text-success">配置维度:</h4></th>
                                <th class="sortable thStyle2"><h4 class="text-success">配置设定:</h4></th>
                                <th class="sortable"><h4 class="text-success text-right">周期设定:</h4></th>
                            </tr>
                        </thead>
                        <tbody>
                            <form id="form1" action="modifyValue" method="post">
                                <g:each in="${com.cindata.riskWarningConfig.findByCode('1')}">
                                    <input type="hidden" name="id" value="${it?.id}">
                                    <input type="hidden" name="isAuto" id="isAuto1" value="">
                                    <tr>
                                        <td> ${it?.label}:</td>
                                        <td>

                                            <div class="input-group">
                                                <span class="input-group-addon">${it?.minOperator}</span>
                                                <input class="form-control" type="text" name="minValue" id ="minValue1" value="<g:formatNumber number="${it?.minValue*100}"  type="number" minFractionDigits="1" maxFractionDigits="1" />">
                                                <span class="input-group-addon">%</span>
                                            </div>
                                        </td>
                                        <td class="text-right">触发方式:</td>
                                        <td>
                                            <div class="radio radio-info radio-inline">
                                                <g:if test="${it?.isAuto}">
                                                    <input type="checkbox" class="i-checks" name="isAuto1" value="true" checked="checked">&nbsp;自动
                                                </g:if>
                                                <g:else>
                                                    <input type="checkbox" class="i-checks" name="isAuto1" value="false">&nbsp;自动
                                                </g:else>
                                            </div>
                                        </td>
                                        <td class="text-right">更新频次:</td>
                                        <td class="tdselect1">
                                            <g:select class="form-control select11" name="duration" id="duration1" from="${[[name:'周末',value:'week'],[name:'月末',value:'month'],[name:'季末',value:'quarter'],[name:'年末',value:'year']]}" optionKey="value" optionValue="name" value="${it?.duration}" noSelection="${['': '请选择']}"/>
                                        </td>
                                        <td class="text-right">工作流:</td>
                                        <td class="tdselect2">
                                            <g:select class="form-control select22" name="workflow" id="workflow1" from="${com.cindata.Workflow.list()}" optionKey="id" optionValue="name" value="${it?.workflow?.id}" noSelection="${['': '请选择']}"/>
                                        </td>
                                        <td class="flex">
                                            <div class="input-group">
                                                <button class="ladda-button btn btn-success submitValue1" data-style="expand-right">提交</button>
                                                <button class="btn btn-warning resetValue1" data-style="expand-right" style="margin-left: 6px;">恢复默认值</button>
                                            </div>
                                        </td>
                                    </tr>
                                </g:each>
                            </form>
                            <form id="form2" action="modifyValue" method="post">
                                <g:each in="${com.cindata.riskWarningConfig.findByCode('2')}">
                                    <input type="hidden" name="id" value="${it?.id}">
                                    <input type="hidden" name ="isAuto" id="isAuto2" value="">
                                    <tr>
                                        <td> ${it?.label}:</td>
                                        <td>

                                            <div class="input-group">
                                                <span class="input-group-addon">${it?.minOperator}</span>
                                                <input class="form-control" type="text" name="minValue" id="minValue2" value="<g:formatNumber number="${it?.minValue*100}"  type="number" minFractionDigits="1" maxFractionDigits="1" />">
                                                <span class="input-group-addon">%</span>
                                            </div>
                                        </td>
                                        <td class="text-right">触发方式:</td>
                                        <td>
                                            <div class="radio radio-info radio-inline">
                                                <g:if test="${it?.isAuto}">
                                                    <input type="checkbox" class="i-checks" name="isAuto2" value="true" checked="checked">&nbsp;自动
                                                </g:if>
                                                <g:else>
                                                    <input type="checkbox" class="i-checks" name="isAuto2" value="false">&nbsp;自动
                                                </g:else>

                                            </div>
                                        </td>
                                        <td class="text-right">更新频次:</td>
                                        <td class="tdselect1">
                                            <g:select class="form-control select11" name="duration" id="duration2" from="${[[name:'周末',value:'week'],[name:'月末',value:'month'],[name:'季末',value:'quarter'],[name:'年末',value:'year']]}" optionKey="value" optionValue="name" value="${it?.duration}" noSelection="${['': '请选择']}"/>
                                        </td>
                                        <td class="text-right">工作流:</td>
                                        <td class="tdselect2">
                                            <g:select class="form-control select22" name="workflow" id="workflow2" from="${com.cindata.Workflow.list()}" optionKey="id" optionValue="name" value="${it?.workflow?.id}" noSelection="${['': '请选择']}"/>
                                        </td>
                                        <td class="flex">
                                            <button class="ladda-button btn btn-success submitValue2" data-style="expand-right">提交</button>
                                            <button class="btn btn-warning resetValue2" data-style="expand-right" style="margin-left: 2px;">恢复默认值</button>
                                        </td>
                                    </tr>
                                </g:each>
                            </form>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    %{--逾期/违约（对公/个人）配置--}%
    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                逾期/违约（对公/个人）配置
            </div>
            <div class="panel-body">
                <div class="table-responsive" style="overflow-x:inherit">
                    <table cellpadding="1" cellspacing="1" class="table text-left" style="border:none">
                        <thead>
                        <tr>
                            <th class="sortable thStyle1"><h4 class="text-success">配置维度:</h4></th>
                            <th class="sortable thStyle2"><h4 class="text-success">配置设定:</h4></th>
                            <th class="sortable"><h4 class="text-success text-right">周期设定:</h4></th>
                        </tr>
                        </thead>
                        <tbody>
                        <form id="form3" action="modifyValue" method="post">
                            <g:each in="${com.cindata.riskWarningConfig.findByCode('3')}">
                                <input type="hidden" name="id" value="${it?.id}">
                                <input type="hidden" name="isAuto" id="isAuto3" value="">
                                <tr>
                                    <td> ${it?.label}:</td>
                                    <td>

                                        <div class="input-group">
                                            <span class="input-group-addon">${it?.minOperator}</span>
                                            <input class="form-control" type="text" name="minValue" id ="minValue3" value="<g:formatNumber number="${it?.minValue}"  type="number" minFractionDigits="0" maxFractionDigits="0" />">
                                            <span class="input-group-addon">次</span>
                                        </div>
                                    </td>
                                    <td class="text-right">触发方式:</td>
                                    <td>
                                        <div class="radio radio-info radio-inline">
                                            <g:if test="${it?.isAuto}">
                                                <input type="checkbox" class="i-checks" name="isAuto3" value="true" checked="checked">&nbsp;自动
                                            </g:if>
                                            <g:else>
                                                <input type="checkbox" class="i-checks" name="isAuto3" value="false">&nbsp;自动
                                            </g:else>
                                        </div>
                                    </td>
                                    <td class="text-right">更新频次:</td>
                                    <td class="tdselect1">
                                        <g:select class="form-control select11" name="duration" id="duration3" from="${[[name:'周末',value:'week'],[name:'月末',value:'month'],[name:'季末',value:'quarter'],[name:'年末',value:'year']]}" optionKey="value" optionValue="name" value="${it?.duration}" noSelection="${['': '请选择']}"/>
                                    </td>
                                    <td class="text-right">工作流:</td>
                                    <td class="tdselect2">
                                        <g:select class="form-control select22" name="workflow" id="workflow3" from="${com.cindata.Workflow.list()}" optionKey="id" optionValue="name" value="${it?.workflow?.id}" noSelection="${['': '请选择']}"/>
                                    </td>
                                    <td class="flex">
                                        <div class="input-group">
                                            <button class="ladda-button btn btn-success submitValue3" data-style="expand-right">提交</button>
                                            <button class="btn btn-warning resetValue3" data-style="expand-right" style="margin-left: 6px;">恢复默认值</button>
                                        </div>
                                    </td>
                                </tr>
                            </g:each>
                        </form>
                        <form id="form4" action="modifyValue" method="post">
                            <g:each in="${com.cindata.riskWarningConfig.findByCode('4')}">
                                <input type="hidden" name="id" value="${it?.id}">
                                <input type="hidden" name ="isAuto" id="isAuto4" value="">
                                <tr>
                                    <td> ${it?.label}:</td>
                                    <td>

                                        <div class="input-group">
                                            <span class="input-group-addon">${it?.minOperator}</span>
                                            <input class="form-control" type="text" name="minValue" id="minValue4" value="<g:formatNumber number="${it?.minValue}"  type="number" minFractionDigits="0" maxFractionDigits="0" />">
                                            <span class="input-group-addon">次</span>
                                        </div>
                                    </td>
                                    <td class="text-right">触发方式:</td>
                                    <td>
                                        <div class="radio radio-info radio-inline">
                                            <g:if test="${it?.isAuto}">
                                                <input type="checkbox" class="i-checks" name="isAuto4" value="true" checked="checked">&nbsp;自动
                                            </g:if>
                                            <g:else>
                                                <input type="checkbox" class="i-checks" name="isAuto4" value="false">&nbsp;自动
                                            </g:else>

                                        </div>
                                    </td>
                                    <td class="text-right">更新频次:</td>
                                    <td class="tdselect1">
                                        <g:select class="form-control select11" name="duration" id="duration4" from="${[[name:'周末',value:'week'],[name:'月末',value:'month'],[name:'季末',value:'quarter'],[name:'年末',value:'year']]}" optionKey="value" optionValue="name" value="${it?.duration}" noSelection="${['': '请选择']}"/>
                                    </td>
                                    <td class="text-right">工作流:</td>
                                    <td class="tdselect2">
                                        <g:select class="form-control select22" name="workflow" id="workflow4" from="${com.cindata.Workflow.list()}" optionKey="id" optionValue="name" value="${it?.workflow?.id}" noSelection="${['': '请选择']}"/>
                                    </td>
                                    <td class="flex">
                                        <button class="ladda-button btn btn-success submitValue4" data-style="expand-right">提交</button>
                                        <button class="btn btn-warning resetValue4" data-style="expand-right" style="margin-left: 2px;">恢复默认值</button>
                                    </td>
                                </tr>
                            </g:each>
                        </form>
                        <form id="form5" action="modifyValue" method="post">
                            <g:each in="${com.cindata.riskWarningConfig.findByCode('5')}">
                                <input type="hidden" name="id" value="${it?.id}">
                                <input type="hidden" name ="isAuto" id="isAuto5" value="">
                                <tr>
                                    <td> ${it?.label}:</td>
                                    <td>

                                        <div class="input-group">
                                            <span class="input-group-addon">${it?.minOperator}</span>
                                            <input class="form-control" type="text" name="minValue" id="minValue5" value="<g:formatNumber number="${it?.minValue}"  type="number" minFractionDigits="0" maxFractionDigits="0" />">
                                            <span class="input-group-addon">次</span>
                                        </div>
                                    </td>
                                    <td class="text-right">触发方式:</td>
                                    <td>
                                        <div class="radio radio-info radio-inline">
                                            <g:if test="${it?.isAuto}">
                                                <input type="checkbox" class="i-checks" name="isAuto5" value="true" checked="checked">&nbsp;自动
                                            </g:if>
                                            <g:else>
                                                <input type="checkbox" class="i-checks" name="isAuto5" value="false">&nbsp;自动
                                            </g:else>

                                        </div>
                                    </td>
                                    <td class="text-right">更新频次:</td>
                                    <td class="tdselect1">
                                        <g:select class="form-control select11" name="duration" id="duration5" from="${[[name:'周末',value:'week'],[name:'月末',value:'month'],[name:'季末',value:'quarter'],[name:'年末',value:'year']]}" optionKey="value" optionValue="name" value="${it?.duration}" noSelection="${['': '请选择']}"/>
                                    </td>
                                    <td class="text-right">工作流:</td>
                                    <td class="tdselect2">
                                        <g:select class="form-control select22" name="workflow" id="workflow5" from="${com.cindata.Workflow.list()}" optionKey="id" optionValue="name" value="${it?.workflow?.id}" noSelection="${['': '请选择']}"/>
                                    </td>
                                    <td class="flex">
                                        <button class="ladda-button btn btn-success submitValue5" data-style="expand-right">提交</button>
                                        <button class="btn btn-warning resetValue5" data-style="expand-right" style="margin-left: 2px;">恢复默认值</button>
                                    </td>
                                </tr>
                            </g:each>
                        </form>
                        <form id="form6" action="modifyValue" method="post">
                            <g:each in="${com.cindata.riskWarningConfig.findByCode('6')}">
                                <input type="hidden" name="id" value="${it?.id}">
                                <input type="hidden" name ="isAuto" id="isAuto6" value="">
                                <tr>
                                    <td> ${it?.label}:</td>
                                    <td>

                                        <div class="input-group">
                                            <span class="input-group-addon">${it?.minOperator}</span>
                                            <input class="form-control" type="text" name="minValue" id="minValue6" value="<g:formatNumber number="${it?.minValue}"  type="number" minFractionDigits="0" maxFractionDigits="0" />">
                                            <span class="input-group-addon">次</span>
                                        </div>
                                    </td>
                                    <td class="text-right">触发方式:</td>
                                    <td>
                                        <div class="radio radio-info radio-inline">
                                            <g:if test="${it?.isAuto}">
                                                <input type="checkbox" class="i-checks" name="isAuto6" value="true" checked="checked">&nbsp;自动
                                            </g:if>
                                            <g:else>
                                                <input type="checkbox" class="i-checks" name="isAuto6" value="false">&nbsp;自动
                                            </g:else>

                                        </div>
                                    </td>
                                    <td class="text-right">更新频次:</td>
                                    <td class="tdselect1">
                                        <g:select class="form-control select11" name="duration" id="duration6" from="${[[name:'周末',value:'week'],[name:'月末',value:'month'],[name:'季末',value:'quarter'],[name:'年末',value:'year']]}" optionKey="value" optionValue="name" value="${it?.duration}" noSelection="${['': '请选择']}"/>
                                    </td>
                                    <td class="text-right">工作流:</td>
                                    <td class="tdselect2">
                                        <g:select class="form-control select22" name="workflow" id="workflow6" from="${com.cindata.Workflow.list()}" optionKey="id" optionValue="name" value="${it?.workflow?.id}" noSelection="${['': '请选择']}"/>
                                    </td>
                                    <td class="flex">
                                        <button class="ladda-button btn btn-success submitValue6" data-style="expand-right">提交</button>
                                        <button class="btn btn-warning resetValue6" data-style="expand-right" style="margin-left: 2px;">恢复默认值</button>
                                    </td>
                                </tr>
                            </g:each>
                        </form>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    %{--集中度风险配置--}%
    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                集中度风险配置
            </div>
            <div class="panel-body">
                <div class="table-responsive" style="overflow-x:inherit">
                    <table cellpadding="1" cellspacing="1" class="table text-left" style="border:none">
                        <thead>
                        <tr>
                            <th class="sortable thStyle1"><h4 class="text-success">配置维度:</h4></th>
                            <th class="sortable thStyle2"><h4 class="text-success">配置设定:</h4></th>
                            <th class="sortable"><h4 class="text-success text-right">周期设定:</h4></th>
                        </tr>
                        </thead>
                        <tbody>
                        <form id="form7" class="col-md-6" action="modifyValue" method="post">
                            <g:each in="${com.cindata.riskWarningConfig.findByCode('7')}">
                                <input type="hidden" name="id" value="${it?.id}">
                                <input type="hidden" name="isAuto" id="isAuto7" value="">
                                <tr>
                                    <td> ${it?.label}:</td>
                                    <td>

                                        <div class="input-group">
                                            <span class="input-group-addon">${it?.minOperator}</span>
                                            <input class="form-control" type="text" name="minValue" id ="minValue7" value="<g:formatNumber number="${it?.minValue}"  type="number" minFractionDigits="1" maxFractionDigits="1" />">
                                            <span class="input-group-addon">分</span>
                                        </div>
                                    </td>
                                    <td class="text-right">触发方式:</td>
                                    <td>
                                        <div class="radio radio-info radio-inline">
                                            <g:if test="${it?.isAuto}">
                                                <input type="checkbox" class="i-checks" name="isAuto7" value="true" checked="checked">&nbsp;自动
                                            </g:if>
                                            <g:else>
                                                <input type="checkbox" class="i-checks" name="isAuto7" value="false">&nbsp;自动
                                            </g:else>
                                        </div>
                                    </td>
                                    <td class="text-right">更新频次:</td>
                                    <td class="tdselect1">
                                        <g:select class="form-control select11" name="duration" id="duration7" from="${[[name:'周末',value:'week'],[name:'月末',value:'month'],[name:'季末',value:'quarter'],[name:'年末',value:'year']]}" optionKey="value" optionValue="name" value="${it?.duration}" noSelection="${['': '请选择']}"/>
                                    </td>
                                    <td class="text-right">工作流:</td>
                                    <td class="tdselect2">
                                        <g:select class="form-control select22" name="workflow" id="workflow7" from="${com.cindata.Workflow.list()}" optionKey="id" optionValue="name" value="${it?.workflow?.id}" noSelection="${['': '请选择']}"/>
                                    </td>
                                    <td class="flex">
                                        <div class="input-group">
                                            <button class="ladda-button btn btn-success submitValue7" data-style="expand-right">提交</button>
                                            <button class="btn btn-warning resetValue7" data-style="expand-right" style="margin-left: 6px;">恢复默认值</button>
                                        </div>
                                    </td>
                                </tr>
                            </g:each>
                        </form>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    %{--押品覆盖率风险配置--}%
    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                押品覆盖率风险配置
            </div>
            <div class="panel-body">
                <div class="table-responsive" style="overflow-x:inherit">
                    <table cellpadding="1" cellspacing="1" class="table text-left" style="border:none">
                        <thead>
                        <tr>
                            <th class="sortable thStyle1"><h4 class="text-success">配置维度:</h4></th>
                            <th class="sortable thStyle2"><h4 class="text-success">配置设定:</h4></th>
                            <th class="sortable"><h4 class="text-success text-right">周期设定:</h4></th>
                        </tr>
                        </thead>
                        <tbody>
                        <form id="form8" class="col-md-6" action="modifyValue" method="post">
                            <g:each in="${com.cindata.riskWarningConfig.findByCode('8')}">
                                <input type="hidden" name="id" value="${it?.id}">
                                <input type="hidden" name="isAuto" id="isAuto8" value="">
                                <tr>
                                    <td> ${it?.label}:</td>
                                    <td>

                                        <div class="input-group">
                                            <span class="input-group-addon">${it?.minOperator}</span>
                                            <input class="form-control" type="text" name="minValue" id ="minValue8" value="<g:formatNumber number="${it?.minValue*100}"  type="number" minFractionDigits="1" maxFractionDigits="1" />">
                                            <span class="input-group-addon">%</span>
                                        </div>
                                    </td>
                                    <td class="text-right">触发方式:</td>
                                    <td>
                                        <div class="radio radio-info radio-inline">
                                            <g:if test="${it?.isAuto}">
                                                <input type="checkbox" class="i-checks" name="isAuto8" value="true" checked="checked">&nbsp;自动
                                            </g:if>
                                            <g:else>
                                                <input type="checkbox" class="i-checks" name="isAuto8" value="false">&nbsp;自动
                                            </g:else>
                                        </div>
                                    </td>
                                    <td class="text-right">更新频次:</td>
                                    <td class="tdselect1">
                                        <g:select class="form-control select11" name="duration" id="duration8" from="${[[name:'周末',value:'week'],[name:'月末',value:'month'],[name:'季末',value:'quarter'],[name:'年末',value:'year']]}" optionKey="value" optionValue="name" value="${it?.duration}" noSelection="${['': '请选择']}"/>
                                    </td>
                                    <td class="text-right">工作流:</td>
                                    <td class="tdselect2">
                                        <g:select class="form-control select22" name="workflow" id="workflow8" from="${com.cindata.Workflow.list()}" optionKey="id" optionValue="name" value="${it?.workflow?.id}" noSelection="${['': '请选择']}"/>
                                    </td>
                                    <td class="flex">
                                        <div class="input-group">
                                            <button class="ladda-button btn btn-success submitValue8" data-style="expand-right">提交</button>
                                            <button class="btn btn-warning resetValue8" data-style="expand-right" style="margin-left: 6px;">恢复默认值</button>
                                        </div>
                                    </td>
                                </tr>
                            </g:each>
                        </form>
                        <form id="form9" action="modifyValue" method="post">
                            <g:each in="${com.cindata.riskWarningConfig.findByCode('9')}">
                                <input type="hidden" name="id" value="${it?.id}">
                                <input type="hidden" name ="isAuto" id="isAuto9" value="">
                                <tr>
                                    <td> ${it?.label}:</td>
                                    <td>

                                        <div class="input-group">
                                            <span class="input-group-addon">${it?.minOperator}</span>
                                            <input class="form-control" type="text" name="minValue" id="minValue9" value="<g:formatNumber number="${it?.minValue*100}"  type="number" minFractionDigits="1" maxFractionDigits="1" />">
                                            <span class="input-group-addon">%</span>
                                        </div>
                                    </td>
                                    <td class="text-right">触发方式:</td>
                                    <td>
                                        <div class="radio radio-info radio-inline">
                                            <g:if test="${it?.isAuto}">
                                                <input type="checkbox" class="i-checks" name="isAuto9" value="true" checked="checked">&nbsp;自动
                                            </g:if>
                                            <g:else>
                                                <input type="checkbox" class="i-checks" name="isAuto9" value="false">&nbsp;自动
                                            </g:else>

                                        </div>
                                    </td>
                                    <td class="text-right">更新频次:</td>
                                    <td class="tdselect1">
                                        <g:select class="form-control select11" name="duration" id="duration9" from="${[[name:'周末',value:'week'],[name:'月末',value:'month'],[name:'季末',value:'quarter'],[name:'年末',value:'year']]}" optionKey="value" optionValue="name" value="${it?.duration}" noSelection="${['': '请选择']}"/>
                                    </td>
                                    <td class="text-right">工作流:</td>
                                    <td class="tdselect2">
                                        <g:select class="form-control select22" name="workflow" id="workflow9" from="${com.cindata.Workflow.list()}" optionKey="id" optionValue="name" value="${it?.workflow?.id}" noSelection="${['': '请选择']}"/>
                                    </td>
                                    <td class="flex">
                                        <button class="ladda-button btn btn-success submitValue9" data-style="expand-right">提交</button>
                                        <button class="btn btn-warning resetValue9" data-style="expand-right" style="margin-left: 2px;">恢复默认值</button>
                                    </td>
                                </tr>
                            </g:each>
                        </form>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    %{--押品效期到期配置--}%
    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                押品效期到期配置
            </div>
            <div class="panel-body">
                <div class="table-responsive" style="overflow-x:inherit">
                    <table cellpadding="1" cellspacing="1" class="table text-left" style="border:none">
                        <thead>
                        <tr>
                            <th class="sortable thStyle1"><h4 class="text-success">配置维度:</h4></th>
                            <th class="sortable thStyle2"><h4 class="text-success">配置设定:</h4></th>
                            <th class="sortable"><h4 class="text-success text-right">周期设定:</h4></th>
                        </tr>
                        </thead>
                        <tbody>
                        <form id="form10" action="modifyValue" method="post">
                            <g:each in="${com.cindata.riskWarningConfig.findByCode('10')}">
                                <input type="hidden" name="id" value="${it?.id}">
                                <input type="hidden" name="isAuto" id="isAuto10" value="">
                                <tr>
                                    <td> ${it?.label}:</td>
                                    <td>

                                        <div class="input-group">
                                            <span class="input-group-addon">${it?.minOperator}</span>
                                            <input class="form-control" type="text" name="minValue" id ="minValue10" value="<g:formatNumber number="${it?.minValue}"  type="number" minFractionDigits="0" maxFractionDigits="0" />">
                                            <span class="input-group-addon">天</span>
                                        </div>
                                    </td>
                                    <td  class="text-right">触发方式:</td>
                                    <td>
                                        <div class="radio radio-info radio-inline">
                                            <g:if test="${it?.isAuto}">
                                                <input type="checkbox" class="i-checks" name="isAuto10" value="true" checked="checked">&nbsp;自动
                                            </g:if>
                                            <g:else>
                                                <input type="checkbox" class="i-checks" name="isAuto10" value="false">&nbsp;自动
                                            </g:else>
                                        </div>
                                    </td>
                                    <td class="text-right">更新频次:</td>
                                    <td class="tdselect1">
                                        <g:select class="form-control select11" name="duration" id="duration10" from="${[[name:'周末',value:'week'],[name:'月末',value:'month'],[name:'季末',value:'quarter'],[name:'年末',value:'year']]}" optionKey="value" optionValue="name" value="${it?.duration}" noSelection="${['': '请选择']}"/>
                                    </td>
                                    <td class="text-right">工作流:</td>
                                    <td class="tdselect2">
                                        <g:select class="form-control select22" name="workflow" id="workflow10" from="${com.cindata.Workflow.list()}" optionKey="id" optionValue="name" value="${it?.workflow?.id}" noSelection="${['': '请选择']}"/>
                                    </td>
                                    <td class="flex">
                                        <div class="input-group">
                                            <button class="ladda-button btn btn-success submitValue10" data-style="expand-right">提交</button>
                                            <button class="btn btn-warning resetValue10" data-style="expand-right" style="margin-left: 6px;">恢复默认值</button>
                                        </div>
                                    </td>
                                </tr>
                            </g:each>
                        </form>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    %{--楼盘评分风险配置--}%
    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                楼盘评分风险配置
            </div>
            <div class="panel-body">
                <div class="table-responsive" style="overflow-x:inherit">
                    <table cellpadding="1" cellspacing="1" class="table text-left" style="border:none">
                        <thead>
                        <tr>
                            <th class="sortable thStyle1"><h4 class="text-success">配置维度:</h4></th>
                            <th class="sortable thStyle2"><h4 class="text-success">配置设定:</h4></th>
                            <th class="sortable"><h4 class="text-success text-right">周期设定:</h4></th>
                        </tr>
                        </thead>
                        <tbody>
                        <form id="form11" action="modifyValue" method="post">
                            <g:each in="${com.cindata.riskWarningConfig.findByCode('11')}">
                                <input type="hidden" name="id" value="${it?.id}">
                                <input type="hidden" name="isAuto" id="isAuto11" value="">
                                <tr>
                                    <td> ${it?.label}:</td>
                                    <td>

                                        <div class="input-group">
                                            <span class="input-group-addon">${it?.minOperator}</span>
                                            <input class="form-control" type="text" name="minValue" id ="minValue11" value="<g:formatNumber number="${it?.minValue}"  type="number" minFractionDigits="1" maxFractionDigits="1" />">
                                            <span class="input-group-addon">分</span>
                                        </div>
                                    </td>
                                    <td class="text-right">触发方式:</td>
                                    <td>
                                        <div class="radio radio-info radio-inline">
                                            <g:if test="${it?.isAuto}">
                                                <input type="checkbox" class="i-checks" name="isAuto11" value="true" checked="checked">&nbsp;自动
                                            </g:if>
                                            <g:else>
                                                <input type="checkbox" class="i-checks" name="isAuto11" value="false">&nbsp;自动
                                            </g:else>
                                        </div>
                                    </td>
                                    <td class="text-right">更新频次:</td>
                                    <td class="tdselect1">
                                        <g:select class="form-control select11" name="duration" id="duration11" from="${[[name:'周末',value:'week'],[name:'月末',value:'month'],[name:'季末',value:'quarter'],[name:'年末',value:'year']]}" optionKey="value" optionValue="name" value="${it?.duration}" noSelection="${['': '请选择']}"/>
                                    </td>
                                    <td class="text-right">工作流:</td>
                                    <td class="tdselect2">
                                        <g:select class="form-control select22" name="workflow" id="workflow11" from="${com.cindata.Workflow.list()}" optionKey="id" optionValue="name" value="${it?.workflow?.id}" noSelection="${['': '请选择']}"/>
                                    </td>
                                    <td class="flex">
                                        <div class="input-group">
                                            <button class="ladda-button btn btn-success submitValue11" data-style="expand-right">提交</button>
                                            <button class="btn btn-warning resetValue11" data-style="expand-right" style="margin-left: 6px;">恢复默认值</button>
                                        </div>
                                    </td>
                                </tr>
                            </g:each>
                        </form>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    %{--舆情预警配置--}%
    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                舆情预警配置
            </div>
            <div class="panel-body">
                <div class="table-responsive" style="overflow-x:inherit">
                    <table cellpadding="1" cellspacing="1" class="table text-left" style="border:none">
                        <thead>
                        <tr>
                            <th class="sortable thStyle1"><h4 class="text-success">舆情配置检索关键词:</h4></th>
                            <th class="sortable thStyle22"><h4 class="text-success">配置设定:</h4></th>
                            <th class="sortable"><h4 class="text-success text-right">周期设定:</h4></th>
                        </tr>
                        </thead>

                        <g:each in="${componentService.evaluate(com.cindata.Component.findByCode('publicOpinionConfig'))?.split(';')}">
                            <g:each in="${com.cindata.riskWarningConfig.findByLabel(it?.split(':')[0])}" var = 'r'>
                                <form action="changeValue" method="post" id="${"form"+r?.id}">
                                    <input type="hidden" name="id" value="${r?.id}">
                                    <input type="hidden" name="isAuto" id="${"isAuto"+r?.id}" value="${r?.isAuto}">
                                    <input type="hidden" name="value" id="${"value"+r?.id}" value="${r?.value}">
                                    <tr>
                                    <td>${it?.split(':')[0]}</td>
                                    <td>
                                        <g:if test="${it?.split(':')?.size() > 1}">
                                            <g:each in="${it?.split(':')[1].split(',')}">
                                                <div class="checkboxStyle" style="">
                                                    <g:if test="${r?.value?.indexOf(it) != -1 && r?.value}">
                                                        <input type="checkbox" class="i-checks value" name="${"value"+r?.id}" value="${it}" checked="checked">&nbsp;${it}
                                                    </g:if>
                                                    <g:else>
                                                        <input type="checkbox" class="i-checks value" name="${"value"+r?.id}" value="${it}" >&nbsp;${it}
                                                    </g:else>

                                                </div>
                                            </g:each>
                                        </g:if>
                                    </td>
                                    <td class="text-right">触发方式:</td>
                                    <td>
                                        <div class="radio radio-info radio-inline">
                                            <g:if test="${r?.isAuto}">
                                                <input type="checkbox" class="i-checks" name="${"isAuto"+r?.id}" value="true" checked="checked">&nbsp;自动
                                            </g:if>
                                            <g:else>
                                                <input type="checkbox" class="i-checks" name="${"isAuto"+r?.id}" value="false">&nbsp;自动
                                            </g:else>
                                        </div>
                                    </td>
                                    <td class="text-right">更新频次:</td>
                                    <td class="tdselect1">
                                        <g:select class="form-control select11" name="duration"  id="${"duration"+r?.id}" from="${[[name:'周末',value:'week'],[name:'月末',value:'month'],[name:'季末',value:'quarter'],[name:'年末',value:'year']]}" optionKey="value" optionValue="name" value="${r?.duration}" noSelection="${['': '请选择']}"/>
                                    </td>
                                    <td class="text-right">工作流:</td>
                                    <td class="tdselect2">
                                        <g:select class="form-control select22" name="workflow" id="${"workflow"+r?.id}" from="${com.cindata.Workflow.list()}" optionKey="id" optionValue="name" value="${r?.workflow?.id}" noSelection="${['': '请选择']}"/>
                                    </td>
                                    <td class="flex">
                                        <div class="input-group">
                                            <button class="ladda-button btn btn-success submitValue" data-style="expand-right" onclick="changeValue(${r?.id});">提交</button>
                                            <button class="btn btn-warning resetValue" data-style="expand-right" style="margin-left: 6px;" onclick="resetValue(${r?.id});">恢复默认值</button>
                                        </div>
                                    </td>
                                </tr>
                                </form>
                            </g:each>

                        </g:each>

                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    
    %{--贷款人预警配置--}%
    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                贷款人预警配置
            </div>
            <div class="panel-body">
                <div class="table-responsive" style="overflow-x:inherit">
                    <table cellpadding="1" cellspacing="1" class="table text-left" style="border:none">
                        <thead>
                        <tr>
                            <th class="sortable thStyle1"><h4 class="text-success">贷款人风控维度:</h4></th>
                            <th class="sortable thStyle22"><h4 class="text-success">配置设定:</h4></th>
                            <th class="sortable"><h4 class="text-success text-right">周期设定:</h4></th>
                        </tr>
                        </thead>
                        <tbody>
                        <g:each in="${componentService.evaluate(com.cindata.Component.findByCode('contactWarningConfig'))?.split(';')}">
                            <g:each in="${com.cindata.riskWarningConfig.findByLabel(it?.split(':')[0])}" var = 'r'>
                                <form action="changeValue" method="post" id="${"form"+r?.id}">
                                    <input type="hidden" name="id" value="${r?.id}">
                                    <input type="hidden" name="isAuto" id="${"isAuto"+r?.id}" value="${r?.isAuto}">
                                    <input type="hidden" name="value" id="${"value"+r?.id}" value="${r?.value}">
                                    <tr>
                                    <td>
                                        <g:if test="${!r?.value || r?.value?.indexOf(it)!=-1}">
                                            <input type="checkbox" class="i-checks" name="${"value"+r?.id}" value="${it?.split(':')[0]}">&nbsp;${it?.split(':')[0]}:
                                        </g:if>
                                        <g:else >
                                            <input type="checkbox" class="i-checks" name="${"value"+r?.id}" value="${it?.split(':')[0]}" checked="checked">&nbsp;${it?.split(':')[0]}:
                                        </g:else>
                                    </td>
                                    <td>
                                        <g:if test="${it?.split(':')?.size() > 1}">
                                            <div>
                                                <g:each in="${it?.split(':')[1]?.split(',')}">
                                                    ${it} &nbsp;
                                                </g:each>
                                            </div>
                                        </g:if>
                                    </td>
                                    <td class="text-right">触发方式:</td>
                                    <td>
                                        <div class="radio radio-info radio-inline">
                                            <g:if test="${r?.isAuto}">
                                                <input type="checkbox" class="i-checks" name="${"isAuto"+r?.id}" value="true" checked="checked">&nbsp;自动
                                            </g:if>
                                            <g:else>
                                                <input type="checkbox" class="i-checks" name="${"isAuto"+r?.id}" value="false">&nbsp;自动
                                            </g:else>
                                        </div>
                                    </td>
                                    <td class="text-right">更新频次:</td>
                                    <td class="tdselect1">
                                        <g:select class="form-control select11" name="duration"  id="${"duration"+r?.id}" from="${[[name:'周末',value:'week'],[name:'月末',value:'month'],[name:'季末',value:'quarter'],[name:'年末',value:'year']]}" optionKey="value" optionValue="name" value="${r?.duration}" noSelection="${['': '请选择']}"/>
                                    </td>
                                    <td class="text-right">工作流:</td>
                                    <td class="tdselect2">
                                        <g:select class="form-control select22" name="workflow" id="${"workflow"+r?.id}" from="${com.cindata.Workflow.list()}" optionKey="id" optionValue="name" value="${r?.workflow?.id}" noSelection="${['': '请选择']}"/>
                                    </td>
                                    <td class="flex">
                                        <div class="input-group">
                                            <button class="ladda-button btn btn-success submitValue" data-style="expand-right" onclick="changeValue(${r?.id});">提交</button>
                                            <button class="btn btn-warning resetValue" data-style="expand-right" style="margin-left: 6px;" onclick="resetValue(${r?.id});">恢复默认值</button>
                                        </div>
                                    </td>
                                </tr>
                                </form>
                            </g:each>
                        </g:each>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

<g:javascript>

    // 押品价值波动风险配置
    var s11 = $( '.submitValue1').ladda();
    s11.click(function(){
        var minValue = $("#minValue1").val();
        if (minValue <= 0 || minValue >= 100)
        {
            toastr.error('请输入正确的价值上升波动范围值！');
            return false;
        }

        s11.ladda('start');
        var isAuto = $("input:checkbox[name='isAuto1']").is(":checked");
        $("#isAuto1").val(isAuto);
        $("#form1").submit();
    });

    $(".resetValue1").click(function(){
        $("#minValue1").val("10.0");
        $("input:checkbox[name='isAuto1']").prop('checked',false);
        $("#workflow1").val("");
        $("#duration1").val("");
        s11.click()
    });
    var s12 = $( '.submitValue2').ladda();
    s12.click(function(){
        var minValue = $("#minValue2").val();
        if (minValue >= 0 || minValue <= -100)
        {
            toastr.error('请输入正确的价值下降波动范围值！');
            return false;
        }

        s12.ladda('start');
        var isAuto = $("input:checkbox[name='isAuto2']").is(":checked");
        $("#isAuto2").val(isAuto);
        $("#form2").submit();
    });

    $(".resetValue2").click(function(){
        $("#minValue2").val("-10.0");
        $("input:checkbox[name='isAuto2']").prop('checked',false);
        $("#workflow2").val("");
        $("#duration2").val("");
        s12.click()
    });
    // 逾期/违约（对公/个人）配置
    var s13 = $( '.submitValue3').ladda();
    s13.click(function(){
        var minValue = $("#minValue3").val();
        if (isNaN(minValue)|| minValue <=0)
        {
            toastr.error('请输入正确的次数值！');
            return false;
        }

        s13.ladda('start');
        var isAuto = $("input:checkbox[name='isAuto3']").is(":checked");
        $("#isAuto3").val(isAuto);
        $("#form3").submit();
    });

    $(".resetValue3").click(function(){
        $("#minValue3").val("6");
        $("input:checkbox[name='isAuto3']").prop('checked',false);
        $("#workflow3").val("");
        $("#duration3").val("");
        s13.click()
    });
    var s14 = $( '.submitValue4').ladda();
    s14.click(function(){
        var minValue = $("#minValue4").val();
        if (isNaN(minValue)|| minValue <=0)
        {
            toastr.error('请输入正确的次数值！');
            return false;
        }

        s14.ladda('start');
        var isAuto = $("input:checkbox[name='isAuto4']").is(":checked");
        $("#isAuto4").val(isAuto);
        $("#form4").submit();
    });

    $(".resetValue4").click(function(){
        $("#minValue4").val("2");
        $("input:checkbox[name='isAuto4']").prop('checked',false);
        $("#workflow4").val("");
        $("#duration4").val("");
        s14.click()
    });
    var s15 = $( '.submitValue5').ladda();
    s15.click(function(){
        var minValue = $("#minValue5").val();
        if (isNaN(minValue)|| minValue <=0)
        {
            toastr.error('请输入正确的次数值！');
            return false;
        }

        s15.ladda('start');
        var isAuto = $("input:checkbox[name='isAuto5']").is(":checked");
        $("#isAuto5").val(isAuto);
        $("#form5").submit();
    });

    $(".resetValue5").click(function(){
        $("#minValue5").val("6");
        $("input:checkbox[name='isAuto5']").prop('checked',false);
        $("#workflow5").val("");
        $("#duration5").val("");
        s15.click()
    });
    var s16 = $( '.submitValue6').ladda();
    s16.click(function(){
        var minValue = $("#minValue6").val();
        if (isNaN(minValue)|| minValue <=0)
        {
            toastr.error('请输入正确的次数值！');
            return false;
        }

        s16.ladda('start');
        var isAuto = $("input:checkbox[name='isAuto6']").is(":checked");
        $("#isAuto6").val(isAuto);
        $("#form6").submit();
    });

    $(".resetValue6").click(function(){
        $("#minValue6").val("2");
        $("input:checkbox[name='isAuto6']").prop('checked',false);
        $("#workflow6").val("");
        $("#duration6").val("");
        s16.click()
    });
    // 楼盘评分风险配置
    var s17 = $( '.submitValue7').ladda();
    s17.click(function(){
        var minValue = $("#minValue7").val();
        if (isNaN(minValue)|| minValue <=0)
        {
            toastr.error('请输入正确的次数值！');
            return false;
        }

        s17.ladda('start');
        var isAuto = $("input:checkbox[name='isAuto7']").is(":checked");
        $("#isAuto7").val(isAuto);
        $("#form7").submit();
    });

    $(".resetValue7").click(function(){
        $("#minValue7").val("3");
        $("input:checkbox[name='isAuto7']").prop('checked',false);
        $("#workflow7").val("");
        $("#duration7").val("");
        s17.click()
    });
    // 押品覆盖率风险配置
    var s18 = $( '.submitValue8').ladda();
    s18.click(function(){
        var minValue = $("#minValue8").val();
        if (isNaN(minValue)|| minValue <=0)
        {
            toastr.error('请输入正确的次数值！');
            return false;
        }

        s18.ladda('start');
        var isAuto = $("input:checkbox[name='isAuto8']").is(":checked");
        $("#isAuto8").val(isAuto);
        $("#form8").submit();
    });

    $(".resetValue8").click(function(){
        $("#minValue8").val("10.0");
        $("input:checkbox[name='isAuto8']").prop('checked',false);
        $("#workflow8").val("");
        $("#duration8").val("");
        s18.click()
    });
    var s19 = $( '.submitValue9').ladda();
    s19.click(function(){
        var minValue = $("#minValue9").val();
        if (isNaN(minValue)|| minValue <=0)
        {
            toastr.error('请输入正确的次数值！');
            return false;
        }

        s19.ladda('start');
        var isAuto = $("input:checkbox[name='isAuto9']").is(":checked");
        $("#isAuto9").val(isAuto);
        $("#form9").submit();
    });

    $(".resetValue9").click(function(){
        $("#minValue9").val("10.0");
        $("input:checkbox[name='isAuto9']").prop('checked',false);
        $("#workflow9").val("");
        $("#duration9").val("");
        s19.click()
    });
    // 押品效期到期配置
    var s110 = $( '.submitValue10').ladda();
    s110.click(function(){
        var minValue = $("#minValue10").val();
        if (isNaN(minValue)|| minValue <=0)
        {
            toastr.error('请输入正确的次数值！');
            return false;
        }

        s110.ladda('start');
        var isAuto = $("input:checkbox[name='isAuto10']").is(":checked");
        $("#isAuto10").val(isAuto);
        $("#form10").submit();
    });

    $(".resetValue10").click(function(){
        $("#minValue10").val("30");
        $("input:checkbox[name='isAuto10']").prop('checked',false);
        $("#workflow10").val("");
        $("#duration10").val("");
        s110.click()
    });
    // 楼盘评分风险配置
    var s111 = $( '.submitValue11').ladda();
    s111.click(function(){
        var minValue = $("#minValue11").val();
        if (isNaN(minValue)|| minValue <=0)
        {
            toastr.error('请输入正确的次数值！');
            return false;
        }

        s111.ladda('start');
        var isAuto = $("input:checkbox[name='isAuto11']").is(":checked");
        $("#isAuto11").val(isAuto);
        $("#form11").submit();
    });

    $(".resetValue11").click(function(){
        $("#minValue11").val("3.0");
        $("input:checkbox[name='isAuto11']").prop('checked',false);
        $("#workflow11").val("");
        $("#duration11").val("");
        s111.click()
    });
    //舆情预警配置&&贷款人预警配置
    function changeValue(id) {
        var isAuto = $("input:checkbox[name='"+"isAuto"+id+"']").is(":checked");
        $("#isAuto"+id+'').val(isAuto);
        var value = $("input:checkbox[name='"+"value"+id+"']:checked").map(function(index,elem) {
            return $(elem).val()
        }).get().join(',');
        $("#value"+id+'').val(value);
        $("#form"+id+'').submit();
    }
    function resetValue(id) {
        $("input:checkbox[name='"+"isAuto"+id+"']").prop('checked',false);
        $("#workflow"+id+'').val("");
        $("#duration"+id+'').val("");
        $("input:checkbox[name='"+"value"+id+"']").prop('checked',false);
        changeValue(id);
    }
</g:javascript>

</body>
</html>
